/* 
 * File:   BoardView.cpp
 * Author: rc
 * 
 * Created on May 28, 2010, 1:15 PM
 */

#include "headers/BoardView.h"
#include <cassert>
#include <cstdlib>
//#include "../Controller/headers/BoardController.h"

BoardView::BoardView(BoardController *bc) {
    assert(bc != NULL);
    mSubject = bc;
    bc->attach(this);

    initSurface();
}

BoardView::BoardView(const BoardView& orig) {
}

BoardView::~BoardView() {
}

void BoardView::initSurface() {
    mSurface = SDL_LoadBMP("graphics/board.bmp");
    
//	filledTrigonRGBA(mSurface,
//					 0,0,
//					 200,200,
//					 400,400,
//					 255,200,100,120);
}

SDL_Surface* BoardView::getSurface() const {
    return mSurface;
}

void BoardView::update(Subject *subjectChanged) {
    assert(subjectChanged != NULL);
    mSubject = dynamic_cast<Subject*>(subjectChanged);
    assert(mSubject != NULL);
    //Re-draw (blit) the surface in the main-window.
    printf("Update was called in boardview.\n");
}

